//
//  AdvertisingNoImageCell.m
//  WanCaiC8
//
//  Created by tangang on 2018/5/7.
//  Copyright © 2018年 tangang. All rights reserved.
//

#import "AdvertisingNoImageCell.h"

@implementation AdvertisingNoImageCell{
    QXLable     *labTitle;
    UIView      *line;
}

- (instancetype)initWithFrame:(CGRect)frame{
    if (self=[super initWithFrame:frame]) {
        line=[[UIView alloc]init];
        line.backgroundColor=DEFAULTBGCOLOR;
        line.hidden=YES;
        [self.contentView addSubview:line];
        [line mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.right.top.equalTo(self.contentView);
            make.height.mas_equalTo(@.7);
        }];
        labTitle=[[QXLable alloc]init];
        labTitle.numberOfLines=0;
        [self.contentView addSubview:labTitle];
        [labTitle mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.equalTo(self.contentView).with.offset(3);
            make.left.equalTo(self.contentView).with.offset(10);
            make.right.equalTo(self.contentView).with.offset(-17);
        }];
    }
    return self;
}

- (void)showLine:(BOOL)isHidden{
    line.hidden=isHidden;
}

- (void)setModel:(AdvertisingModel *)model{
    
    if ([model.Title containsString:@"【"]) {
        labTitle.attributedText = [NSAttributedString tg_imageTextWithTitle:model.Title];
        
    } else {
        labTitle.text=model.Title;
        
    }
    
//    labTitle.text=model.Title;
//    [labTitle setSpace:5];
}

@end
